const express = require('express');
const router = express.Router();
const storeController = require('../controllers/storeController');
const authMiddleware = require('../middlewares/auth');
const adminMiddleware = require('../middlewares/admin');

// 所有门店路由需要认证
router.use(authMiddleware);

// 获取所有门店
router.get('/', storeController.getAllStores);

// 创建新门店 (仅管理员)
router.post('/', adminMiddleware, storeController.createStore);

// 获取单个门店
router.get('/:id', storeController.getStore);

// 更新门店信息 (仅管理员)
router.put('/:id', adminMiddleware, storeController.updateStore);

// 更新门店状态 (仅管理员)
router.put('/:id/status', adminMiddleware, storeController.updateStoreStatus);

// 删除门店 (仅管理员)
router.delete('/:id', adminMiddleware, storeController.deleteStore);

module.exports = router; 